using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace One_Crappy_RPG
{
    public class Monster : Creature
    {
        public Monster(string name, int level)
        {
            Name = name;
            Stats.Level = level;

            Initialize();
        }

        public virtual void Initialize()
        {
            Stats.Strength = Stats.Level * 5;
            Stats.Intelligence = Stats.Level * 5;
            Stats.Speed = Stats.Level * 5;
            Stats.Agility = Stats.Level * 5;

            Stats.CurrentHealth = Stats.Level * 20;
            Stats.MaxHealth = Stats.Level * 20;
            Stats.MaxMP = Stats.Level * 10;
            Stats.CurrentMP = Stats.Level * 10;

            Stats.Defense = Stats.Level * 5;
            Stats.MagicDefense = Stats.Level * 3;

            Stats.CurrentXP = Stats.Level * 25;

            drawColor = Color.White;

            Position = new Vector2(300.0f, 300.0f);
            

        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Attack(Creature target)
        {
            base.Attack(target);
        }

        public override void CastSpell(Spell name, Creature target)
        {
        }


        //Uber AI goes here
        public override void HandleTurn(List<Creature> targets)
        {
            List<Creature> potentials = new List<Creature>();

            //Ordinary attack
            foreach (Creature target in targets)
            {
                if (target is Hero)
                    potentials.Add(target);
            }

            Attack(potentials[rng.Next(potentials.Count)]);
        }
    }
}
